package com.lagou.java;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.EventLoopGroup;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * 用于保存客户端信息
 */
public class NettyClientInfo {

    private List<String> remoteAdress = new CopyOnWriteArrayList<>();
    private String localAddress;
    private String node;
    private Map<String, ChannelFuture> channelFuture = new ConcurrentHashMap<>();
    private EventLoopGroup group;
    private Bootstrap bootstrap;
    private ChannelInboundHandlerAdapter handler;

    public List<String> getRemoteAdress() {
        return remoteAdress;
    }

    public void setRemoteAdress(List<String> remoteAdress) {
        this.remoteAdress = remoteAdress;
    }

    public String getLocalAddress() {
        return localAddress;
    }

    public void setLocalAddress(String localAddress) {
        this.localAddress = localAddress;
    }

    public String getNode() {
        return node;
    }

    public void setNode(String node) {
        this.node = node;
    }

    public Map<String, ChannelFuture> getChannelFuture() {
        return channelFuture;
    }

    public void setChannelFuture(Map<String, ChannelFuture> channelFuture) {
        this.channelFuture = channelFuture;
    }

    public EventLoopGroup getGroup() {
        return group;
    }

    public void setGroup(EventLoopGroup group) {
        this.group = group;
    }

    public Bootstrap getBootstrap() {
        return bootstrap;
    }

    public void setBootstrap(Bootstrap bootstrap) {
        this.bootstrap = bootstrap;
    }

    public ChannelInboundHandlerAdapter getHandler() {
        return handler;
    }

    public void setHandler(ChannelInboundHandlerAdapter handler) {
        this.handler = handler;
    }
}
